/*
 * ResourseManager.h
 *
 *  Created on: 18/01/2011
 *      Author: Nenem
 */

#ifndef RESOURCEMANAGER_H_
#define RESOURCEMANAGER_H_

#include "Tools.h"

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>

#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#include <stdlib.h>

//TODO temporally or not

struct INFO{
	Point2D PC;
	int wC;
	int hC;
	Point2D PD;
	int wD;
	int hD;
	Point2D PA;
	int wA;
	int hA;

	Point2D PI;
	int wI;
	int hI;
	int frames;
	int frameRate;
};

class ResourceManager {
private:
	string PATH;
	SDL_Surface *idleSprite;
	SDL_Surface *walkSprite;
	SDL_Surface *runSprite;
	SDL_Surface *attackSprite;
	SDL_Surface *grass_normal;
	INFO IDLE_EAST;
	INFO IDLE_WEST;
	INFO IDLE_SOUTH;
	INFO IDLE_NORTH;
	INFO WALK_EAST;
	INFO WALK_WEST;
	INFO WALK_SOUTH;
	INFO WALK_NORTH;
	INFO RUN_EAST;
	INFO RUN_WEST;
	INFO RUN_NORTH;
	INFO RUN_SOUTH;
	INFO ATTACK_EAST;
	INFO ATTACK_SOUTH;
	INFO ATTACK_WEST;
	INFO ATTACK_NORTH;
public:
	ResourceManager();
	virtual ~ResourceManager();
	void readInfo(string folderName);
	void readIdleFile(string folderName);
	void readWalkFile(string folderName);
	void readRunFile(string folderName);
	void readAttackFile(string folderName);
	void redifinePoints();
	vector<string> breakString(string str, char ch);
    SDL_Surface *getGrass_normal() const
    {
        return grass_normal;
    }

    void setGrass_normal(SDL_Surface *grass_normal)
    {
        this->grass_normal = grass_normal;
    }

    void setIdleSprite(SDL_Surface *idleSprite)
    {
        this->idleSprite = idleSprite;
    }

    SDL_Surface *getAttackSprite() const
    {
        return attackSprite;
    }

    SDL_Surface *getIdleSprite() const
    {
        return idleSprite;
    }

    SDL_Surface *getRunSprite() const
    {
        return runSprite;
    }

    SDL_Surface *getWalkSprite() const
    {
        return walkSprite;
    }

    void setWalkSprite(SDL_Surface *walkSprite)
    {
        this->walkSprite = walkSprite;
    }

    INFO getIDLE_NORTH() const
    {
        return IDLE_NORTH;
    }

    INFO getIDLE_SOUTH() const
    {
        return IDLE_SOUTH;
    }

    INFO getIDLE_WEST() const
    {
        return IDLE_WEST;
    }

    INFO getRUN_NORTH() const
    {
        return RUN_NORTH;
    }

    INFO getRUN_SOUTH() const
    {
        return RUN_SOUTH;
    }

    INFO getRUN_WEST() const
    {
        return RUN_WEST;
    }

    INFO getWALK_NORTH() const
    {
        return WALK_NORTH;
    }

    INFO getWALK_SOUTH() const
    {
        return WALK_SOUTH;
    }

    INFO getWALK_WEST() const
    {
        return WALK_WEST;
    }

    void setRUN_EAST(INFO RUN_EAST)
    {
        this->RUN_EAST = RUN_EAST;
    }

    INFO getATTACK_EAST() const
    {
        return ATTACK_EAST;
    }

    INFO getATTACK_NORTH() const
    {
        return ATTACK_NORTH;
    }

    INFO getATTACK_SOUTH() const
    {
        return ATTACK_SOUTH;
    }

    INFO getATTACK_WEST() const
    {
        return ATTACK_WEST;
    }

    INFO getIDLE_EAST() const
    {
        return IDLE_EAST;
    }

    INFO getRUN_EAST() const
    {
        return RUN_EAST;
    }

    INFO getWALK_EAST() const
    {
        return WALK_EAST;
    }

    void setATTACK_NORTH(INFO ATTACK_NORTH)
    {
        this->ATTACK_NORTH = ATTACK_NORTH;
    }

};

#endif /* RESOURSEMANAGER_H_ */
